//
//  BLProgressHUD.m
//  BLUIKit
//
//  Created by macos on 2023/2/20.
//

#import "BLProgressHUD.h"
#import "BLProgressHUD+private.h"

@implementation BLProgressHUD{
    MBProgressHUD *_hud;
}

#pragma mark - Public
+ (void)showError:(NSString *)error{
    [self showMsg:error toView:[self getWindow] autoHide:YES];
}

+ (void)showSuccess:(NSString *)success{
    [self showMsg:success toView:[self getWindow] autoHide:YES];
}

+ (BLProgressHUD*)showHud:(NSString *)msg inView:(id)inView{
    BLProgressHUD *h = [BLProgressHUD new];
    [h->_hud hideAnimated:false];
    h->_hud = nil;
    
    MBProgressHUD *hh = [self showMsg:msg toView:inView autoHide:NO];
    h->_hud = hh;
    return h;
}

- (void)hide{
    [_hud hideAnimated:YES];
    _hud = nil;
}



@end
